package com.jeomo.shiro.bean;

import com.jeomo.shiro.enums.PlatformEnum;
import org.apache.shiro.authc.UsernamePasswordToken;

import java.io.Serializable;

/**
 * 自定义一个UsernamePasswordToken,主要声明一个登陆类型，区分不同的登录， 比如C端登录/后台登录等等，然后以不同的Realm进行鉴权
 * @author qbt
 */
public class CustomizedUsernamePasswordToken extends UsernamePasswordToken implements Serializable {

    public CustomizedUsernamePasswordToken(String orgCode, String username, String password, String platform) {
        super(username, password);
        this.loginPlatform = PlatformEnum.valueOf(platform);
        this.orgCode = orgCode;
    }

    private String orgCode;

    /**
     * 登录类型
     */
    private PlatformEnum loginPlatform;

    public PlatformEnum getLoginPlatform() {
        return loginPlatform;
    }

    public void setLoginPlatform(PlatformEnum loginPlatform) {
        this.loginPlatform = loginPlatform;
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String topOrgCode) {
        this.orgCode = topOrgCode;
    }
}
